package com.SinaMicrobloggingApi.Core.Response;

import java.lang.reflect.Type;
import java.util.List;

import com.SinaMicrobloggingApi.Model.DirectMessagesModel;
import com.SinaMicrobloggingApi.Model.StatusModel;
import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;

public class DirectMessagesResponse extends ResponseBase {

	private List<DirectMessagesModel> directMessages;

	public List<DirectMessagesModel> getDirectMessages() {
		return directMessages;
	}

	public void setDirectMessages(List<DirectMessagesModel> directMessages) {
		this.directMessages = directMessages;
	}

	@Override
	public void ParseResult(String result) {
		super.ParseResult(result);
		if (errorModel == null) {
			// TODO Auto-generated method stub
			Gson gson = new Gson();
			Type listType = new TypeToken<List<DirectMessagesModel>>() {
			}.getType();
			directMessages = gson.fromJson(result, listType);
		}

	}

}
